#include <iostream>
#include <pthread.h>
#include <unistd.h>

void *sub_thread(void* arg){
	const char* str = (const char*)arg;
	while(true){
		std::cout<<"我是其他线程，我的信息为："<<str<<std::endl;
		sleep(1);
	}
}

int main()
{
	pthread_t tid;
	int ret = pthread_create(&tid, nullptr, sub_thread, (void*)"first try");

	while(true){
		std::cout<<"我是主线程"<<std::endl;
		sleep(1);
	}

	return 0;
}